package com.cy.ppj.dao.mapper.user;

import com.cy.ppj.model.domian.user.User;
import com.cy.ppj.model.dto.user.UserInfoDTO;
import com.cy.ppj.model.dto.user.UserLoginDTO;
import com.cy.ppj.model.enums.UserType;
import com.cy.ppj.model.query.ChannelUserByCompanyAdminQuery;
import com.cy.ppj.model.query.ChannelUserBySalesAdminQuery;
import com.cy.ppj.model.query.ChannelUserBySalesQuery;
import com.cy.ppj.model.query.UserAdminQuery;
import com.cy.ppj.model.query.account.BrokerInfoQuery;
import com.cy.ppj.model.query.statistics.ChannelUserGroupByCityStatisticsQuery;
import com.cy.ppj.model.vo.ChannelUserAdminVO;
import com.cy.ppj.model.vo.ChannelUserByCompanyAdminVO;
import com.cy.ppj.model.vo.ChannelUserBySalesAdminVO;
import com.cy.ppj.model.vo.ChannelUserBySalesVO;
import com.cy.ppj.model.vo.UserDetailAdminVO;
import com.cy.ppj.model.vo.admin.statistics.ChannelUserGroupByCityStatisticsVO;
import com.cy.ppj.model.vo.admin.statistics.UserStructureStatisticsVO;
import com.cy.ppj.model.vo.SalesUserAdminVO;

import com.cy.ppj.model.vo.front.account.AccountIndexVO;
import com.cy.ppj.model.vo.front.account.BrokerInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    void insertBatch(List<User> users);

    UserLoginDTO login(@Param("mobile") String mobile, @Param("password") String password);

    UserLoginDTO loginByWechat(@Param("openId") String openId);

    UserInfoDTO queryUserInfo(@Param("userId") Long userId, @Param("type") UserType type);

    int queryChannelUserListCount(UserAdminQuery channelUserAdminQuery);
    
    List<ChannelUserAdminVO> queryChannelUserList(UserAdminQuery channelUserAdminQuery);
    
    UserDetailAdminVO queryUserDetailAdmin(@Param("userId") Long userId);
    
    int querySalesUserListCount(UserAdminQuery userAdminQuery);
    
    List<SalesUserAdminVO> querySalesUserList(UserAdminQuery userAdminQuery);
    
    int queryChannelUserBySalesAdminCount(ChannelUserBySalesAdminQuery channelUserBySalesAdminQuery);
    
    List<ChannelUserBySalesAdminVO> queryChannelUserBySalesAdmin(ChannelUserBySalesAdminQuery channelUserBySalesAdminQuery);

	int queryChannelUserBySalesCount(ChannelUserBySalesQuery channelUserBySalesQuery);

	List<ChannelUserBySalesVO> queryChannelUserBySales(ChannelUserBySalesQuery channelUserBySalesQuery);
	
	int queryChannelUserByCompanyAdminCount(ChannelUserByCompanyAdminQuery query);
	
	List<ChannelUserByCompanyAdminVO> queryChannelUserByCompanyAdmin(ChannelUserByCompanyAdminQuery query);

	AccountIndexVO selectAccountIndexInfo(@Param("userId") Long userId);

	BrokerInfoVO selectBrokerInfo(BrokerInfoQuery query);

    BrokerInfoVO selectBrokerInfo2(BrokerInfoQuery query);
	
	List<UserStructureStatisticsVO> selectUserStructureStatisticsVOs();

	List<ChannelUserGroupByCityStatisticsVO> selectchannelUserGroupByCityStatisticsVOs(ChannelUserGroupByCityStatisticsQuery query);
}
